<template>
    <div class="dashboard-container">
        <List :rowData="rowData" v-if="page == 'list'" @changePage="changePage" />
    </div>
</template>

<script>
import List from "./list";


export default {
    name: 'zbjk',
    components: {
        List,
    },
    data() {
        return {
            loading: false,
            id: '',
            page: "list", //  list | add | edit
            rowData:{}
        }
    },

    mounted() {
    },
    methods: {
        changePage(page, payload) {
            console.log(page, payload)
            if (payload && page == "list") {
                this.rowData = payload || "";
            }
            if (payload && page == "config") {
                 this.rowData = payload || "";
            }
            if (this.page == page) {
                this.page = "";
                this.$nextTick(() => {
                    this.page = page;
                });
            } else {
                this.page = page;
            }

            console.log(this.page)
        },

    }
}
</script>

<style lang="scss" scoped>
.dashboard-container {
    width: 100%;
    min-height: 100%;
    background-color: #fff;
    padding: 8px;

}
</style>
